Computer systems frequently include multiple memory modules, such as dynamic random access memory (DRAM), solid state drives (SSDs) and hard disk drives (HDDs). The memory modules interface with the operating systems of and/or applications on the host computers with which memory modules are used. The memory modules may have different latencies. For example, the latency for an access of a DRAM is typically approximately fifty nanoseconds for both read and write transactions. HDDs and SSDs have latencies that are significantly longer than that of a DRAM. The latencies for these devices are typically greater than fifty microseconds for read and write transactions.
During use, the operating system or other application may write data to or read data from a memory module. For example, the central processing unit (CPU) of the system may issue a read request or a write request for the appropriate module. Such memory module transactions take time to complete. For some modules, the CPU (or operating system/application) switches from the transaction being performed (memory module access) to another task for some predefined time. The CPU later switches back to the memory module transaction. This process is known as context switching.
Context switching is not without a penalty. A context switch typically requires at least five through fifteen microseconds to complete. As such, the computer system only performs context switching for memory modules with a high latency. For HDDs and SDDs, the latency is greater than fifty microseconds. For such high latency devices, context switching is performed for transactions because the time taken for the memory module transaction is greater than the penalty for context switching. For a low latency module such as DRAM, the latency of fifty nanoseconds is less than the penalty for context switching. For such an access the CPU waits for the access to complete and context switching is not performed. Thus, the determination of whether to context switching is preset and depends upon the type of memory module. Although context switching is useful, greater control over transactions with the memory modules may be desired.